<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${ctx }/js/plugs/jquery-ui-1.10.3.custom/css/mycss/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" />
<title>奖项设置</title>
<link href="${ctx}/js/plugs/validate/jquery.validate.css" type="text/css" rel="stylesheet" />
<script src="${ctx}/js/plugs/validate/jquery.validate.js" type="text/javascript"></script>
<script src="${ctx}/js/plugs/validate/messages_cn.js" type="text/javascript"></script>
<script src="${ctx }/js/plugs/validate/jquery.metadata.js" type="text/javascript"></script>
<script type="text/javascript">	
function checkForm(){
	var id = $('#lotteryActivityId').val();
	var url = "/sy/lottery/checkActivityStatusAjax.do";
	var data="id="+id;
	var ajaxFlag = false;
	$.ajax({
		url:url,
		data:data,
		async:false,
		type:"post",
		success:function(data){
			if (data == "1") {
				alert("已经有用户参加了抽奖活动，无法重置");
				ajaxFlag =  false;
			} else {
				if(confirm("核对无误，确认重新发布?")){
					ajaxFlag  = true;
				} else {
					ajaxFlag =  false;
				}
			}
		}
	});
	return ajaxFlag;
}
</script>
<style type="text/css">
table{
	margin: 0 auto;
	border-collapse: collapse:separate;
	border-spacing:15px 20px;
}
.std{
	text-align:right;
}
.stext{
	width:40px;
}
</style>
</head>
<body>

	<div id="dwBody">
		<div id="dwBodyContent" class="bodyCenter" style="">
			<div id="dwBodyUser">
				<div class="surveyCollectMiddle">
				<div style="border-bottom: 1px solid #DFDFDF;padding: 5px;color: #666565;">奖项设置</div>
				<form id="inputForm" action="${ctx }/sy/lottery/prize/reset.do?id=${lp.lotteryActivityId }" method="post" onsubmit="return checkForm()">
					<input type="hidden" name="lotteryActivityId" id="lotteryActivityId" value="${lp.lotteryActivityId }">
					<table border="0">
						<tr> 
							<td colspan="8" style="text-align:center"><h3>奖项设置</h3></td>
						</tr>
						<tr>
							<td>参与人数:</td>
							<td>${lp.participants }</td>
							<td>次数:</td>
							<td>${lp.partTimes }</td>
							<td>奖项总数:</td>
							<td><font color="blue" id="prizeTotal">${lp.participants * lp.partTimes }</font></td>
							<td>剩余可分配数:</td>
							<td><font color="red" id="prizeRest">0</font></td>
						</tr>
						<tr>
							<td>奖项一:</td>
							<td>${lp.prizeList[0].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[0].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[0].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[0].qti }</td>
						</tr>
						<tr>
							<td>奖项二:</td>
							<td>${lp.prizeList[1].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[1].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[1].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[1].qti }</td>
						</tr>
						<tr>
							<td>奖项三:</td>
							<td>${lp.prizeList[2].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[2].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[2].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[2].qti }</td>
						</tr>
						<tr>
							<td>奖项四:</td>
							<td>${lp.prizeList[3].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[3].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[3].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[3].qti }</td>
						</tr>
						<tr>
							<td>奖项五:</td>
							<td>${lp.prizeList[4].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[4].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[4].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[4].qti }</td>
						</tr>
						<tr>
							<td>奖项六:</td>
							<td>${lp.prizeList[5].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[5].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[5].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[5].qti }</td>
						</tr>
						<tr>
							<td>奖项七:</td>
							<td>${lp.prizeList[6].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[6].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[6].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[6].qti }</td>
						</tr>
						<tr>
							<td>奖项八:</td>
							<td>${lp.prizeList[7].prizeTypeName }</td>
							<td class="std" >描述:</td>
							<td>${lp.prizeList[7].description }</td>
							<td class="std">数值:</td>
							<td>${lp.prizeList[7].value }</td>
							<td class="std">数量:</td>
							<td>${lp.prizeList[7].qti }</td>
						</tr>
						<tr> 
							<td colspan="8">
							<input type="submit" value="重置" class="sbtn25 sbtn25_1" style="margin-left: 125px;">
							<input type="button" value="返回" class="sbtn25 sbtn25_1" style="margin-left: 325px;" onclick="javascript:history.back(-1);">
							</td>
						</tr>
					</table>
					</form>
				</div>
			</div>
		</div>
	</div>


</body>
</html>